<%@ page language="java" import="java.util.*"  pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<link href="../css/common.css" rel="stylesheet">
<script type="text/javascript" src="../yibiao/jquery-1.8.3.min.js"></script>
<!--<script src="../yibiao/exporting.js"></script>-->
<script src="../yibiao/highcharts.js"></script>
<script src="../yibiao/yemian.js"></script>
<link href="../yibiao/ext4.2/ext4.2/resources/css/ext-all-neptune.css" rel="stylesheet">
    <link  rel="stylesheet"  href="../yibiao/style.css"/>
	<!--<link rel="stylesheet" href="yibiao/content.css" />-->
    <script src="../yibiao/ext4.2/ext4.2/ext-all.js" type="text/javascript"></script>
    <script type="text/javascript" src="../yibiao/ext4.2/ext4.2/locale/ext-lang-zh_CN.js"></script>
   <script type="text/javascript" src="../yibiao/echarts-all.js"></script>
   <script type="text/javascript" src="../yibiao/index.js"></script>
   <style>
   li{ list-style:none;}ul{ list-style:none;}
   div#chart-body {
    margin-top: 55px;
}
.chaxundas{ height:60px; background:#063741; margin:0 auto;overflow: hidden;}
.chaxundas li{ float:left; text-align:center; font-size:14px; color:#ffffff;height:35px; width:10%; margin-top:11px;}
.chaxundas li p{ float:left; line-height:8px;}
.chaxundas li span{ margin-left:5px;padding: 5px 10px 5px 10px;}
.chaxundas li input{ width: 78%; height:35px; border-radius:5px; border:0px; padding-left:5px; float:left; opacity:1; margin-right:10px;}
.chaxundas li select{width:50%; height:35px; border-radius:5px; border:0px; padding-left:6px; float:left}

.demo0{position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999; margin:0 auto;}
.big4{  float:left; position:absolute; width:100%;
    top: 365px;
}}
.subnav1{ width:100%; height:40px;    background: #063f4a;}
.subnav1 li{ float:left; width:100px;height:30px; margin-top:10px; background:url(../images/3.gif) repeat-x; line-height:30px; text-align:center; color:#9bc1ce;  cursor:pointer; background:#0a2a3a;    margin-left: 5px; border-top-left-radius: 10px; border-top-right-radius: 10px;}
	
	.all{ width:100%; height:auto; /*overflow-y:auto*/}
.active1{background:#084756!important; color:#ffffff !important;   }
.subnav1 li a{ color:#000; font-size:15px; font-weight:bold; margin-left:20px;}
.subnav-neirong1{   margin-top:10px;}

.erbox{ width:100%; float:left;}
.xiala{ margin-left:40px;}

.lie1{background:#063a46; font-size:13px; width:100%; color:#b2d6e0; float:left; height:400px;/*   overflow: scroll;*/}
.lie1 ul{  background:#063a46; height:39px;color:#b2d6e0; padding-left:48px; line-height:39px; margin:0;}
.lie1 ul li{ line-height:39px; float:left; font-size:14px; text-align:center; width:32%; color:#b1d6e0;}
.lie1 ul li p{ font-size:14px; color:#b1d6e0; float:left; margin:0;}
.lie1 ul li span{ color:#ffffff; float:left}
.lie1 ul:nth-child(odd){ background-color:053744}
.lie1 ul:nth-child(even){ background:#05323e;}
#ext-gen1018{overflow-y:auto !important; overflow-x:hidden !important}
.lixian{    background: #888888;color: #bbbbbb; width:50px; height:25px; border-radius:4px; text-align:center;}
.zaixian{    background:#56d753;color: #000000; width:50px; height:25px; border-radius:4px; text-align:center;}
.guzhang{    background:#ed9246;color: #bbbbbb; width:50px; height:25px; border-radius:4px; text-align:center;}
</style>
</head>

<body style="overflow-y:scroll">
<div class="demo0">
    <ul class="chaxundas">
    
    <li style=" width:20% !important"><p>车辆：</p><select><option>车辆选择</option><option>车辆选择</option></select>
    </li>
    <li><input type="button" value="数据查询" style=" background:#22abd4; color:#ffffff; text-align:center; padding:0;"></li>
	<li><input type="button" value="车辆回放" style=" background:#22abd4; color:#ffffff; text-align:center; padding:0;"></li>
	<li><input type="button" value="车辆跟踪" style=" background:#22abd4; color:#ffffff; text-align:center; padding:0;"></li>  
	<li style=" width:23% !important"><p>数据时间：<span>2016-12-07  15:15:00</span></p></li>
	<li style=" width:18% !important"><p>车辆状态：<span class="lixian">离线</span></p></li>
    </ul>
</div>



<div class="big4">
        	<div class="subnav1" style="width:100%; height:40px;    background: #063f4a;">
            	<li tt="teb01" class="active1"> 实时图表</li>
                <li tt="teb02">电池信息</li>
                <li tt="teb03">电机信息</li>
				<li tt="teb04">其他信息</li>
            </div>
            <div class="all">
                <div class="subnav-neirong1 teb01">
                	<select class="xiala" id='select_parameter' onchange="reset()">
                		<option value="vehicle_speed">车速</option>
                		<option value="total_vol">电池总电压</option>
                		<option value="total_cur">电池总电流</option>
                		<option value="soc">SOC</option>
                		<option value="motor_speed">电机转速</option>
                		<option value="motor_nm">电机扭矩</option>
                		<option value="motor_temp">电机温度</option>
                	</select>
                    <div id="shishi" style="min-width:400px;height:300px"></div>
                </div>
				
                 <div class="subnav-neirong1 teb02" style="display:none;">
						<div id="er1" style="min-width:800px;height:300px"></div>
						<div id="er2" style="min-width:800px;height:300px"></div>
						<div id="er3" style="min-width:800px;height:300px;display:none"></div>
						<div id="er4" style="min-width:800px;height:300px;display:none"></div>
					
                    <!--内容行-->
        <div class="lie1">
        	<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
			<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
        </div>
                </div>
                 <div class="subnav-neirong1 teb03" style="display:none;">
                    <div class="lie1">
        	<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
			<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
        </div> 
                </div>
				<div class="subnav-neirong1 teb04" style="display:none;">
                    <div class="lie1">
        	<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
			<ul><li><p>车牌号：</p><span></span></li><li><p>电机冷却方式：</p><span></span></li><li><p>终端生产商：</p><span></span></li></ul>
            <ul><li><p>车架号：</p><span></span></li><li><p>额定电压：</p><span></span></li><li><p>终端编号：</p><span></span></li></ul>
            <ul><li><p>车辆类型：</p><span></span></li><li><p>最大工作电流： </p><span></span></li><li><p>终端生产日期：</p><span></span></li></ul>
            <ul><li><p>最高车速：</p><span></span></li><li><p>电机编号：</p><span></span></li><li><p>SIM 卡号：</p><span></span></li></ul>
            <ul><li><p>续航里程：</p><span></span></li><li><p>电机类型： </p><span></span></li><li><p>ICCID 号：</p><span></span></li></ul>
        </div> 
                </div>
            </div>
            <div style="clear:both"></div>
        </div>
<script type="text/javascript">
	var id = getUrl("vehicleid")?getUrl("vehicleid"):'',
		    //车辆名字                            
			name = getUrl("name")?getUrl("name"):'',
			//纬度                                  
			latitude,
			//经度
			longtitude,
			//选择车辆列表是否单选的标志
			flag = true,
			//实时信息定时器
			interval,
			//全局遮罩
			mask,	
			//实时更新方法
			setRealtimeInfo,
			//其他信息
			qita,
			//存储车速数组
			chesuArr = [],
			//上一次选择的vin码
			preVin;
	function getUrl(name) {
		    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
		    var r = window.location.search.substr(1).match(reg);
		    if (r != null) return unescape(r[2]); return null;
		}		
    $(document).ready(function () {
    	$(".subnav1 li").click(function(){
			$(this).addClass("active1").siblings().removeClass("active1");
			var tt=$(this).attr("tt");
			$(this).parents(".subnav1").siblings(".all").children("."+tt).show().siblings().hide();
			});
		//设置数据更新定时器
		interval = setInterval(checkId,5000);   
    });
	 	
		
		function checkId(){
			if(id!=""&&id!=null){
				setRealtimeInfo();
			}
		}
			setRealtimeInfo = function(){
				$.ajax({
				async: false,
				type : "get",
				url : "<%=basePath%>vehicle/selectAllByOne.do?vehicleid="+id,
				datatype: "json",
				success : function(data){
				    	/*
				    	 | 如果返回的JSON是无效的，decode方法返回null
				    	 */
  						 var list = eval("(" + data + ")");
				        /*
				         | 整车状态-左边数据
				         */
				        carload.machineLeft1_1Option.series[0].data[0].value = list[0].total_vol;
				        carload.machineLeft1_1Chart.setOption(carload.machineLeft1_1Option,true);
				        
				        carload.machineLeft2_1Option.series[0].data[0].value = list[0].total_cur;
				        carload.machineLeft2_1Chart.setOption(carload.machineLeft2_1Option,true);
				        
				        SOCControl(list[0].soc);
				        $('#machineSOC').html(list[0].soc);
				        $('#machineDisc').html(list[0].soc*200);
				        
				        /*
				         | 整车状态-中间数据-上部分
				         */
				        speedControl(list[0].vehicle_speed);
				       	$('#machineODO').html(parseInt(list[0].total_mileage));
				        //$('#machineTrip').html(parseInt(infoHash.getValue('本次里程')));
				        readyControl(list[0].vehicle_status);
				        gearControl(list[0].vehicle_gear);
				        
				        /*
				         | 整车状态-中间数据-下部分
				         */
						$('#machineAccelerate').html(list[0].acc_pedal_stroke+"%");
						if(list[0].brake_pedal_status==0){
							$("#machineBrake").html("未制动");
						}else if(list[0].brake_pedal_status>=1&&list[0].brake_pedal_status<=100){
							$("#machineBrake").html(list[0].brake_pedal_status+"%");
						}else if(list[0].brake_pedal_status==101){
							$("#machineBrake").html("制动");
						}else{
							$("#machineBrake").html("无效");
						}
				       // $('#machineErrorCode').html(infoHash.getValue('故障代码'));
				        statueIconControl(
				        	list[0].warning_flag,//整车故障码
				        	list[0].charging_status,//充电状态
				        	list[0].vehicle_gear,//档位
				        	list[0].soc,//电量
				        	list[0].vehicle_status//infoHash.getValue('钥匙信号状态')
				        );
				       
				        /*
				         | 整车状态-右边仪表盘数据
				         */
				         //电机温度
				        carload.machineRight1_1Option.series[0].data[0].value = list[0].motor_temp;
				        carload.machineRight1_1Chart.setOption(carload.machineRight1_1Option,true);
						//电机控制器温度
				        carload.machineRight2_1Option.series[0].data[0].value = list[0].motor_control_temp;
				        carload.machineRight2_1Chart.setOption(carload.machineRight2_1Option,true);
				        //电机转速
				        carload.machineRight1_2Option.series[0].data[0].value = (parseFloat(list[0].motor_speed)/1000).toFixed(2);
				        carload.machineRight1_2Chart.setOption(carload.machineRight1_2Option,true);
				        
				        //电机功率
				        var p=list[0].motor_speed*list[0].motor_nm/9550;
				        carload.machineRight2_2Option.series[0].data[0].value = p.toFixed(2);
				        carload.machineRight2_2Chart.setOption(carload.machineRight2_2Option,true);
				        //电机电压
				        carload.machineRight1_3Option.series[0].data[0].value = list[0].motor_vol;
				        carload.machineRight1_3Chart.setOption(carload.machineRight1_3Option,true);
				        //电机电流
				        carload.machineRight2_3Option.series[0].data[0].value = list[0].motor_cur;
				        carload.machineRight2_3Chart.setOption(carload.machineRight2_3Option,true);
  						
  						var parameter=$("#select_parameter").val();
  						//alert(parameter);
  						setSpline(list[0][parameter],list[0].vehicle_status);
				    }
				});
			};
		Ext.onReady(function() {
			//车辆选择条件panel变量
		    var formPanel = Ext.create('Ext.form.Panel',{
		    	
        	});
	var tabPanel = Ext.create('Ext.tab.Panel',{
		        activeTab: 0,
		        plain: true,
		        id:'chart',
		        deferredRender:false,
		        region:'center',
		        defaults :{
		            autoScroll: true
		        },
		        
		        items: [{
	        		
	        		
	        		items:[{
	        			xtype:'panel',
	        			layout:'column',
	        			border:false,
	        			items:[{
	        				id:'machineLeftDashboard',
	        				bodyStyle:'border-width:0 1px 1px 0;border-color:#B1B8BD;',
	        				layout:'column',
	        				columnWidth: 0.4,
	        				height:300,
	        				defaults:{
	        					border:false
	        				},
	        				items:[{
	        					columnWidth: 1,
	        					height:300,
	        					items:[{
	        						id:'machineLeft1_1',//1_1代表左边1行1列,即表示左边的仪表盘1行1列的位置
	        						height:150
	        					},{
	        						xtype:'panel',
	        						id:'machineLeft2_1',
	        						height:150
	        					}]
	        				},{
	        					width:130,
	        					height:300,
	        					//machineLeft_right代表左边仪表盘的右边部分（电池）
	        					html:'<div class="machineLeft_right">' +
			        					'<ul><li><div class="machineBattery"><span class="battZIndex3"></span><span class="battZIndex2" id="machineBatteryControl"></span><span class="battZIndex1"></span></div></li>' +
			        					'<li><div class="machineSOCDiv"><span>SOC：</span><span id="machineSOC">0</span><span> %</span></div></li>' +
			        					'<li><div class="machineDiscDiv"><span><img src="../yibiao/images/disc.png" title="预驶里程"/></span><span>：</span><span id="machineDisc">0</span><span> km</span></div></li>' +
		        					'</ul></div>'
	        				}]
	        			},{   //中间数据
	        				id:'machineCenterDashboard',
	        				width:470,
	        				bodyStyle:'border-width:0 0 1px 0;border-color:#B1B8BD;',
	        				height:300,
	        				html:'<div class="machineCenter">' +
	        						'<div class="machineCenter_top">' +
		        						'<div class="machineCenter_top_top">'+
		        							'<div class="machineSpeed">' +
		        								'<span class="machineImage">' +
		        									'<i><img src="../yibiao/images/0.png"/></i>' +
		        									'<i><img src="../yibiao/images/0.png"/></i>' +
		        									'<i><img src="../yibiao/images/0.png"/></i>' +
	        									'</span>' +
	        									'<span class="speedUnit"><b>km/h</b></span>' +
	       									'</div>' +
	       									'<div class="machineReady"><img src="../yibiao/images/ready_2.png"/></div>'+
	       								'</div>'+
	       								'<div class="machineCenter_top_bottom">' +
	       									'<span class="machineMileage"><ul>' +
	       										'<li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;总里程(ODO)：</span><span id="machineODO" class="odoSpanWidth">0000</span><span class="odoSpanWidth1">　km</span></li>' +
	       										'</ul>' +
       										'</span>' +
	       									'<span id="machineGear"><img src="../yibiao/images/R.png"/></span>'+
       									'</div>'+
       								'</div>'+
       								'<div class="machineCenter_bottom">' +
       									'<div class="machineCenter_bottom_top"><ul>' +
       										'<li class="machineAcc"><span>加速踏板：</span><span id="machineAccelerate" class="machineSpanWidth">0</span></li>' +
       										'<li class="machineBra"><span>制动踏板：</span><span id="machineBrake" class="machineSpanWidth">0</span></li>' +
       										
     									'</div>' +
       									'<div class="machineCenter_bottom_bottom">' +
       										'<span><img src="../yibiao/images/err_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/battery_err_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/electric_err_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/charging_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/brake_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/chargingLine_no_act.png"/></span>' +
       										'<span><img src="../yibiao/images/keyStatue_no_act.png"/></span>' +
       									'</div>' +
       								'</div>' +
	        					'</div>'
	        			},{
	        				id:'machineRightDashboard',
	        				columnWidth: 0.6,
	        				layout:'column',
	        				bodyStyle:'border-width:0 0 1px 1px;border-color:#B1B8BD;',
	        				height:300,
	        				defaults:{
	        					border:false
	        				},
	        				items:[{
	        					columnWidth: 0.33,
	        					height:300,
	        					items:[{
	        						id:'machineRight1_1',
	        						height:150
	        					},{
	        						id:'machineRight2_1',
	        						height:150
	        					}]
	        				},{
	        					xtype:'panel',
	        					columnWidth: 0.34,
	        					height:300,
	        					items:[{
	        						id:'machineRight1_2',
	        						height:150
	        					},{
	        						id:'machineRight2_2',
	        						height:150
	        					}]
	        				},{
	        					xtype:'panel',
	        					columnWidth: 0.33,
	        					height:300,
	        					items:[{
	        						id:'machineRight1_3',
	        						height:150
	        					},{
	        						id:'machineRight2_3',
	        						height:150
	        					}]
	        				}]
	        			}]
	        		},]
	        	},]
	    	});
			
			//解决页面切换图表没有自适应的问题
			tabPanel.on('tabchange',function(){
				carload.resizeAll();
				//carBattery.resizeAll();
			});
			
			/*
			 *页面整体布局
			 */ 
		    Ext.create('Ext.container.Viewport', {
			    layout: 'border',
			    id:'view',
			    minWidth:1150,
			    minHeight:300,
			    autoScroll:'auto',
			    overflowX:'auto',
			    overflowY:'hidden',
			    items:[formPanel,tabPanel]
			});
			//初始化
		    (function(){
   		 		var docWidth = Ext.getBody().getWidth() - 20;
				setDivWidth(['battery','batteryVol'],docWidth); 		 		
   		 		carload.init();
   		 		//carBattery.init();
   		 	})();
		});
		
		//调整图表渲染div的宽度和高度,需要设置宽高，或者无法显示图表。
	    function setDivWidth(ids,t){
			for(var i = 0,length = ids.length;i < length; i++){
				$('#'+ids[i]).width(t);
			}
		};

		//自定义车辆选择方法
		function getVehicleData(items){
			Ext.getCmp('selectedRegs').setValue(items[1]);
			vin = items[0];
			//清除定时器
			if(interval){
				clearInterval(interval);
			}
			//重置车速折线图
			chesuArr = [];
			carload.setMachineLine(null,true);
			//重置图表
			carload.init();
  		 	carBattery.init();
			//显示遮罩
			mask.show();
			//清除电池状态图表
			removeBatteryInfos();
			//清除注册信息列表
			removeRegisterInfos();
			setRealtimeInfo();
			interval = setInterval(setRealtimeInfo,2000);
		};

		//设置仪表盘SOC
	 	function SOCControl(value){
			if(value == ''){
				value = 0;
			}
			if(value <0 || value>100 || value == '')
				return;
			else{
				//计算需要遮盖的高度
				var height = 175 - (value/100)*160;
				$('#machineBatteryControl').css('height',height);
			}
		 };
		 
		//设置仪表盘车速
	 	function speedControl(value){
			if(value == '' || value == null){
				value = 0;
			}else{
				value = parseFloat(value);
			}
			var hundreds,tens,ones;
			if(value < 0 || value > 999){
				return;
			}else{
				var hundreds = value%100>0?value/100:0;
				var tens = value/10>0?value/100:0;
				if(value < 10){
					hundreds = 0;
					tens = 0;
					ones = parseInt(value);
				}else if(value < 100){
					hundreds = 0;
					tens = parseInt(value/10);
					ones = parseInt(value - tens * 10);
				}else{
					hundreds = parseInt(value/100);
					tens = parseInt((value - hundreds * 100)/10);
					ones = parseInt(value - hundreds * 100 - tens * 10);
				}
				var imgs =  $('.machineImage img');
				imgs[0].src = '../yibiao/images/'+hundreds+'.png';
				imgs[1].src = '../yibiao/images/'+tens+'.png';
				imgs[2].src = '../yibiao/images/'+ones+'.png';
			}
	 	};
	 	
	 	//设置速度折线图
	 	function speedChartControl(chesu,status){
	        if(chesu == ''){
	        	chesu = 0;
	        }
	        if(chesuArr.length <= 0){
				chesuArr = [];
				for(var i = 0; i < 15; i++){
					chesuArr.push(chesu);
				}
				carload.setMachineLine(chesuArr,false);
			}
	        if(status=='在线'){
       	 		var lastData = chesu,
					axisData = (new Date()).toLocaleTimeString().replace(/^\D*/,'');
				for(var i = 0;i < 14;i++){
					chesuArr[i] = chesuArr[i+1];
				}
				chesuArr[14] = chesu;
				carload.machineLineChart.addData([
					[
			            0,        // 系列索引
			            lastData, // 新增数据
			            false,    // 新增数据是否从队列头部插入
			            false,    // 是否增加队列长度，false则自定删除原有数据，队头插入删队尾，队尾插入删队头
			            axisData  // 坐标轴标签
			        ]
			    ]);
	        }
	 	};
	 	
	 	//设置ready状态
		function readyControl(status){
			var img = $('.machineReady img');
	 		if(status==1){
				img[0].src = '../yibiao/images/ready_2.png';
			}else{
				img[0].src = '../yibiao/images/ready_1.png';
			}
	 	};
	 	
	 	//设置档位
	 	function gearControl(gear){
	 		var img = $('#machineGear img');
	 		if(gear == null || img == null) return;
	 		if(gear%16==0){
	 				img[0].src = '../yibiao/images/N.png';
				}else if((gear%16>=1&&gear%16<=5)||gear%16==14){
					img[0].src = '../yibiao/images/D.png';
				}else if(gear%16==6||gear%16==13){
					img[0].src = '../yibiao/images/R.png';
				}else if(gear%16==15){
					img[0].src = '../yibiao/images/P.png';
				}else{
					return;
				}
	 	};
	 	
	 	//设置图标信息
		function statueIconControl(warning_flag,charging_status,gear,soc,vehicle_status){
			var imags = $('.machineCenter_bottom_bottom img');
			//钥匙信号状态
			if(vehicle_status == 1){
				setIconStatus(imags[6],'../yibiao/images/keyStatue_act.png','钥匙状态：on');
			}else{
				setIconStatus(imags[6],'../yibiao/images/keyStatue_no_act.png','钥匙状态：LOCK');
			}
			//充电链接状态
			if(charging_status==1){
				setIconStatus(imags[5],'../yibiao/images/chargingLine_act.png','充放电状态：停车充电');
			}else if(charging_status==2){
				setIconStatus(imags[5],'../yibiao/images/chargingLine_act.png','充放电状态：行驶充电');
			}else{
				setIconStatus(imags[5],'../yibiao/images/chargingLine_no_act.png','充放电状态：未充电');
			}
			//驻车状态
			if(gear%16==15){
				setIconStatus(imags[4],'../yibiao/images/brake_act.png','驻车状态：制动');
			}else{
				setIconStatus(imags[4],'../yibiao/images/brake_no_act.png','驻车状态：无');
			}
			//充电状态
			if(soc<=15){
				setIconStatus(imags[3],'../yibiao/images/charging_act.png','充电提醒：低于电量阈值，需充电');
			}else{
				setIconStatus(imags[3],'../yibiao/images/charging_no_act.png','充电提醒：无');
			}
			//电机故障
			//if(!checkErrorCode(dianji)){
			//	setIconStatus(imags[2],'images/electric_err_act.png','电机故障：故障');
			//}else{
			//	setIconStatus(imags[2],'images/electric_err_no_act.png','电机故障：无');
			//}
			//电池故障
			if(warning_flag%65536>0){
				setIconStatus(imags[1],'../yibiao/images/battery_err_act.png','电池故障：故障');
			}else{
				setIconStatus(imags[1],'../yibiao/images/battery_err_no_act.png','电池故障：无');
			}
			//系统故障
			if(warning_flag>0){
				setIconStatus(imags[0],'../yibiao/images/err_act.png','系统故障：故障');
			}else{
				setIconStatus(imags[0],'../yibiao/images/err_no_act.png','系统故障：无');
			}
		};
		

		
		//设置图标状态
		function setIconStatus(obj,src,title){
			obj.src = src;
			obj.title = title;
		};

 		
 		//设置echart图表的值
 		function setEchartValue(id,nameArr,valueArr){
        	carBattery[id+'Option'].series[0].data = valueArr;
       	 	carBattery[id+'Option'].xAxis[0].data = nameArr;
        	carBattery[id+'Chart'].setOption(carBattery[id+'Option'],true); 			
 		};
 		$(function(){
			/*$(".left-nav").height($(window).height()-94);
			$(".jiantou").height($(window).height()-94);
			$(".right-content").height($(window).height()-104);
			$(".panel-body-noborder").height($(window).height()-104);
			$("body").height($(window).height()-80);*/
		});
	</script>
</body>
</html>
